<?php

Route::get('/', 'WelcomeController@index');

Route::get('home', 'HomeController@index');
Route::resource('votes', 'VotesController', ['except' => ['index', 'show']]);
Route::get('vote/{id}', 'VotesController@votePost');

Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {
  Route::get('', ['as' => 'admin', 'uses' => 'AdminController@index']);
  Route::get('system', ['as' => 'admin.system', 'uses' => 'AdminController@system']);
  Route::get('admin', ['as' => 'admin.admin', 'uses' => 'AdminController@admin']);

  Route::resource('users', 'UsersController', ['only' => ['index']]);
  Route::post('users/set_admin/{id}', 'UsersController@postSetAdmin');

  Route::resource('votes', 'VotesController', ['except' => ['create', 'show', 'store']]);
  Route::get('votes/{type}/list', 'VotesController@index');
  Route::post('votes/passed/{id}', 'VotesController@postPassed');
  Route::post('votes/locked/{id}', 'VotesController@postLocked');
});

Route::controllers([
  'auth' => 'Auth\AuthController',
  'password' => 'Auth\PasswordController',
]);
